<!DOCTYPE html>
<html>
<body>
    <h1>JavaScript 函数</h1>
    <p>可以在不调用的情况下自动调用函数：</p>
    <p id="demo"></p>
    <script>
        (function () {
            document.getElementById("demo").innerHTML = "Hello! I called myself";
        })();
    </script>
</body>
</html>